<?php
if(!defined('OT_ROOT')) {
	exit('Access Denied');
}



class UcUsers{
	// 注册页
	public static function RegWeb(){
		global $DB,$userSysArr,$userApiArr;

		$announ = $announ2 = '';
		if (strlen(trim(''. Str::RegExp($userSysArr['US_regAnnoun'],'html'))) >= 3){
			$announ = '<div class="loginBox" style="width:100%;line-height:1.4;">'. $userSysArr['US_regAnnoun'] .'</div>';
		}
		if (strlen(trim(''. Str::RegExp($userSysArr['US_regAnnoun2'],'html'))) >= 3){
			$announ2 = '<div class="loginBox" style="width:100%;line-height:1.4;">'. $userSysArr['US_regAnnoun2'] .'</div>';
		}

		if ($userSysArr['US_isReg'] == 0){
			return '<div style="margin:0 auto; padding:35px 0 20px 0; text-align:center;">会员注册已关闭，有问题请联系管理员</div>'. $announ;
		}

		$backURL	= OT::GetStr('backURL');
		$isBack		= OT::GetInt('isBack');
		$recomId	= OT::GetInt('id');
			if ($isBack == 1){ $backURL = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; }
			if ($recomId > 0){
				Users::SetCookies('recomId', $recomId);
			}else{
				$recomId = OT::ToInt(Users::GetCookies('recomId'));
			}

		$username = Users::Username();
		if ($username != ''){
			$force		= OT::GetInt('force');
			if ($force == 1){
				$userRow = Users::Open('get','','',$judUserErr);
					if ((! $userRow) || $judUserErr != ''){
						
					}else{
						JS::HrefEnd('usersCenter.php');
					}
			}else{
				JS::HrefEnd('usersCenter.php');
			}
		}

		$addiFieldArr = array();
		if (strpos($userSysArr['US_regFieldStr'], '|邮箱|') !== false){
			if (strpos($userSysArr['US_regFieldStr'], '|邮箱必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
			$addiFieldArr[$btStr .'95'] = '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-email"></span>
						<input type="text" id="mail" name="mail" class="inputs" onblur="CheckMail()" placeholder="'. $btStr .'请输入邮箱" />
					</div>
					<span id="mailIsOk" class="isok"></span>
					<p id="mailStr" class="errMsg"></p>
				</div>
				'. ($userSysArr['US_regAuthMail']==1 ? '
				<div class="form-item">
					<div class="input-warp s">
						<span class="input-icon iconfont icon-yanzhengma"></span>
						<input type="text" id="mailCode" name="mailCode" class="inputs" placeholder="请输入邮箱验证码" />
					</div>
					<div class="pull-right">
						<input type="button" id="sendMail" class="btn lgbtn blue" onclick=\'SendMailCode(this.id,"mail","regCode","username");\' value="发送验证码" />
					</div>
				</div>
				' : '');
		}
		if (strpos($userSysArr['US_regFieldStr'], '|手机|') !== false){
			if (strpos($userSysArr['US_regFieldStr'], '|手机必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
			$addiFieldArr[$btStr .'90'] = '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-shouji"></span>
						<input type="text" id="phone" name="phone" class="inputs" onblur="CheckPhone()" placeholder="'. $btStr .'请输入手机" />
					</div>
					<span id="phoneIsOk" class="isok"></span>
					<p id="phoneStr" class="errMsg"></p>
				</div>
				'. ($userSysArr['US_regAuthPhone']==1 ? '
				<div class="form-item">
					<div class="input-warp s">
						<span class="input-icon iconfont icon-yanzhengma"></span>
						<input type="text" id="phoneCode" name="phoneCode" class="inputs" placeholder="请输入短信验证码" />
					</div>
					<div class="pull-right">
						<input type="button" id="sendPhone" class="btn lgbtn blue" onclick=\'SendPhoneCode(this.id,"phone","regCode","username");\' value="发送验证码" />
					</div>
				</div>
				' : '');
		}
		if (strpos($userSysArr['US_regFieldStr'], '|昵称|') !== false){
			if (strpos($userSysArr['US_regFieldStr'], '|昵称必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
			$addiFieldArr[$btStr .'80'] = '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-xingming"></span>
						<input type="text" id="realname" name="realname" class="inputs" placeholder="'. $btStr .'请输入昵称（QQ网名或姓名）" />
					</div>
				</div>
				';
		}
		if (strpos($userSysArr['US_regFieldStr'], '|QQ|') !== false){
			if (strpos($userSysArr['US_regFieldStr'], '|QQ必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
			$addiFieldArr[$btStr .'70'] = '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-qq"></span>
						<input type="text" id="qq" name="qq" class="inputs" placeholder="'. $btStr .'请输入QQ" />
					</div>
				</div>
				';
		}
		if (strpos($userSysArr['US_regFieldStr'], '|微信|') !== false){
			if (strpos($userSysArr['US_regFieldStr'], '|微信必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
			$addiFieldArr[$btStr .'60'] = '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-weixin"></span>
						<input type="text" id="weixin" name="weixin" class="inputs" placeholder="'. $btStr .'请输入微信" />
					</div>
				</div>
				';
		}
		if (strpos($userSysArr['US_regFieldStr'], '|旺旺|') !== false){
			if (strpos($userSysArr['US_regFieldStr'], '|旺旺必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
			$addiFieldArr[$btStr .'50'] = '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-hangye"></span>
						<input type="text" id="ww" name="ww" class="inputs" placeholder="'. $btStr .'请输入旺旺" />
					</div>
				</div>
				';
		}
		krsort($addiFieldArr);

		$rndMd5 = md5(md5(OT_SiteID . session_id()) . OT_SiteID . Users::GetIp());

		$retStr = '
			'. $announ .'
			<h2 class="title text-center">用户注册</h2>
			<form id="regForm" name="regForm" method="post" action="users_deal.php?m=reg" onsubmit="return CheckRegForm();">
				<input type="hidden" id="rndMd5" name="rndMd5" value="'. $rndMd5 .'" />
				<input type="hidden" id="backURL" name="backURL" value="'. urlencode($backURL) .'" />
				<input type="hidden" id="pwdMode" name="pwdMode" value="" />
				<input type="hidden" id="pwdKey" name="pwdKey" value="" />
				<input type="hidden" id="pwdEnc" name="pwdEnc" value="" />
				<input type="hidden" id="recomId" name="recomId" value="'. $recomId .'" />
				<input type="hidden" id="judRegCode" name="judRegCode" value="'. (AppQuan::JudReg() ? 1 : 0) .'" />
				<input type="hidden" id="regFieldStr" name="regFieldStr" value="'. $userSysArr['US_regFieldStr'] .'" />
			';
		if (AppQuan::JudReg()){
			// 注册邀请码
			$quanSysArr = Cache::PhpFile('quanSys');
			$inputAlt = $strAlt = '';
			if (strlen($quanSysArr['QS_regNote']) > 39 || strpos($quanSysArr['QS_regNote'],'<') !== false){
				$strAlt = '<div style="padding:2px;">'. $quanSysArr['QS_regNote'] .'</div>';
			}elseif (strlen($quanSysArr['QS_regNote']) > 0){
				$inputAlt = '('. Str::RegExp($quanSysArr['QS_regNote'],'html') .')';
			}
			$retStr .= '
				<div class="form-item">
					<div class="input-warp">
						<span class="input-icon iconfont icon-code"></span>
						<input class="inputs" type="text" id="regCode" name="regCode" placeholder="请输入注册邀请码'. $inputAlt .'" />
					</div>
					'. AppMoneyQuick::RegItem('uc') . $strAlt .'
				</div>
				';
		}
		$retStr .= '
			<div class="form-item">
				<div class="input-warp">
					<span class="input-icon iconfont icon-yonghu1"></span>
					<input type="text" id="username" name="username" class="inputs" placeholder="请输入用户名" />
				</div>
				<span id="usernameIsOk" class="isok"></span>
				<p id="usernameStr" class="errMsg"></p>
			</div>
			<div class="form-item">
				<div class="input-warp">
					<span class="input-icon iconfont icon-baomi"></span>
					<input id="userpwd" type="password" placeholder="请输入密码" onblur="CheckUserPwd()" name="userpwd" class="inputs"/>
				</div>
				<span id="userpwdIsOk" class="isok"></span>
				<p id="userpwdStr" class="errMsg"></p>
			</div>
			<div class="form-item">
				<div class="input-warp">
					<span class="input-icon iconfont icon-baomi"></span>
					<input id="userpwd2" type="password" placeholder="再输入密码" onblur="CheckUserPwd2()" name="userpwd2" class="inputs"/>
				</div>
				<span id="userpwd2IsOk" class="isok"></span>
				<p id="userpwd2Str" class="errMsg"></p>
			</div>
			'. implode('',$addiFieldArr) .'
			<!-- <div class="form-item">
				<div class="input-warp">
					<span class="input-icon iconfont icon-baomi"></span>
					<input id="question" type="text" placeholder="请输入密保问题" onblur="CheckQuestion()" name="question" class="inputs"/>
				</div>
				<span id="questionIsOk" class="isok"></span>
				<p id="questionStr" class="errMsg"></p>
			</div>
			<div class="form-item">
				<div class="input-warp">
					<span class="input-icon iconfont icon-baomi"></span>
					<input id="answer" type="text" placeholder="请输入密保答案" onblur="CheckAnswer()" name="answer" class="inputs"/>
				</div>
				<span id="answerIsOk" class="isok"></span>
				<p id="answerStr" class="errMsg"></p>
			</div>  -->
			';
		if (AppRecom::Jud()){
			// 邀请人信息
			// '. AppRecom::RegItem($recomId, 'pc') .'
			$tmpStr = '<input type="hidden" id="isRecomUser" name="isRecomUser" value="0" />';
			if ($userSysArr['US_isRegRecomUser'] >= 1){
				$recomUser = $DB->GetOne('select UE_username from '. OT_dbPref .'users where UE_ID='. $recomId,'','','');
				if ($userSysArr['US_isRegRecomUser'] == 2 && strlen($recomUser) == 0){
					if (strpos($userSysArr['US_regFieldStr'], '|邀请人必填|') !== false){ $btStr = ''; }else{ $btStr = '[可选] '; }
					$tmpStr = '
						<input type="hidden" id="isRecomUser" name="isRecomUser" value="2" />
						<div class="form-item">
							<div class="input-warp s">
								<span class="input-icon iconfont icon-user1"></span>
								<input type="text" id="recomUser" name="recomUser" class="inputs" placeholder="'. $btStr .'请填写邀请人" />
							</div>
							<div class="pull-right">
								<input type="button" id="sendPhone" value="　检　测　" class="btn lgbtn blue" onclick="CheckRecomUser($id(\'recomUser\').value);" />
							</div>
						</div>
						';
				}elseif ($recomId > 0){
					if (strlen($recomUser) == 0){ $recomUser = '无'; }
					$tmpStr = '
						<input type="hidden" id="isRecomUser" name="isRecomUser" value="1" />
						<li class="name">邀请人：<span style="font-weight:bold;color:blue;">'. $recomUser .'</span></li>
						';
				}
			}
			$retStr .= $tmpStr;
		}
		$retStr .= '
			<div class="form-item" style="display:none">
				<div class="input-warp" style="border:0">
				<div style="float:left;">注册协议：</div>
				<label><input type="radio" name="isAgree" value="yes" checked="true" style="background:none;" />同意</label>
				<label><input type="radio" name="isAgree" value="no" style="background:none;" />不同意</label>
				</div>
			</div>
			'. UcBase::VerCode('regForm') .'
			<div class="btn-warp">
				<div class="text-center">
					<button class="btn lgbtn blue btn-block">注册</button>
				</div>
			</div>
			<div class="agreement gap">
				<div class="text-right">
					<div class="pull-left">已有账号，<a href="?m=login" class="link">登录</a></div>
					<p>注册即代表您已阅读并同意《<a href="javascript:void(0);" onclick="ClickShowHidden(\'regNoteBox\');return false;" class="link">使用协议</a>》</p>
				</div>
				<div id="regNoteBox" class="regNote font1_1" style="display:none;">
					'. $userSysArr["US_regNote"] .'
				</div>
			</div>
		</form>
		<div class="biggap third-party-title">
			<h5 class="text-center"><span>第三方账号登录</span></h5>
		</div>
		<div class="third-auth">
			'. str_replace('[backURL]', urlencode($backURL), @$userApiArr['imgLoginWap'] .'') .'
		</div>
		'. $announ2 . self::BottomInfo();

		return $retStr;

	}



	// 登录页
	public static function LoginWeb(){
		global $DB,$systemArr,$userSysArr,$userApiArr,$logoStr;

		$announ = $announ2 = '';
		if (strlen(trim(''. Str::RegExp($userSysArr['US_loginAnnoun'],'html'))) >= 3){
			$announ = '<div class="loginBox" style="width:100%;line-height:1.4;">'. $userSysArr['US_loginAnnoun'] .'</div>';
		}
		if (strlen(trim(''. Str::RegExp($userSysArr['US_loginAnnoun2'],'html'))) >= 3){
			$announ2 = '<div class="loginBox" style="width:100%;line-height:1.4;">'. $userSysArr['US_loginAnnoun2'] .'</div>';
		}

		if ($userSysArr['US_isLogin'] == 0){
			return '<div style="margin:0 auto; padding:35px 0 20px 0; text-align:center;">会员登录已关闭，有问题请联系管理员</div>'. $announ;
		}

		$backURL	= OT::GetStr('backURL');
		$isBack		= OT::GetInt('isBack');
			if ($isBack == 1){ $backURL = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; }
		$mode		= OT::GetStr('mode');
			if ($mode == 'wxmp' && AppWeixin::Jud()){
				return AppWeixin::Login($announ, 'uc');
			}

		$username = Users::Username();
		if ($username != ''){
			$force		= OT::GetInt('force');
			if ($force == 1){
				$userRow = Users::Open('get','','',$judUserErr);
					if ((! $userRow) || $judUserErr != ''){
						
					}else{
						JS::HrefEnd('usersCenter.php');
					}
			}else{
				JS::HrefEnd('usersCenter.php');
			}
		}

		if (empty($_SESSION['VerCodeNum'])){ $_SESSION['VerCodeNum']=0; }
		if ($_SESSION['VerCodeNum'] >= 2 || strpos($systemArr['SYS_verCodeStr'],'|login|') !== false){ $verCodeStyle=''; }else{ $verCodeStyle='none'; }

		$expTimeStr = '';
		if ($userSysArr['US_isLoginExp'] > 0){
			$expTimeStr = '
				<input type="checkbox" value="'. $userSysArr['US_isLoginExp'] .'" name="expTime">
				<label for="remember" style="font-weight: normal" >登录状态保存'. StrCN::LoginExp($userSysArr['US_isLoginExp']) .'</label>';
		}

		$qrCodeStr = '';
		if (AppWeixin::Jud()){
			if ($userSysArr['US_isLoginWeixinMp'] == 1){
				$qrCodeStr = '<div class="wx_login"><a href="?m=login&mode=wxmp" title="微信扫码登录" style=""><img src="inc_img/loginQrcode.png" /></a></div>';
			}
		}

		$loginModeCurr = '';
		$loginModeArr = array();
		if ($userSysArr['US_isLoginUser'] == 1){
			$loginModeArr[] = array('rank'=>$userSysArr['US_loginUserRank'], 'type'=>'username', 'name'=>'用户名登录');
		}
		if ($userSysArr['US_isLoginMail'] >= 1 && AppLoginMail::Jud()){
			$loginModeArr[] = array('rank'=>$userSysArr['US_loginMailRank'], 'type'=>'mail', 'name'=>'邮箱登录');
		}
		if ($userSysArr['US_isLoginPhone'] >= 1 && AppLoginPhone::Jud()){
			$loginModeArr[] = array('rank'=>$userSysArr['US_loginPhoneRank'], 'type'=>'phone', 'name'=>'手机登录');
		}
		$rankArr = array();
		foreach ($loginModeArr as $key => $val){
			$rankArr[$key]  = $val['rank'];
		}
		array_multisort($rankArr, SORT_ASC, SORT_NUMERIC, $loginModeArr);
		$loginModeStr = '';
		foreach ($loginModeArr as $item){
			if (strlen($loginModeStr) == 0){
				$loginModeCurr = $item['type'];
				$loginModeStr .= '
					<div id="login_'. $item['type'] .'" class="pointCurr" onclick="LoginModeTab(\''. $item['type'] .'\')">'. $item['name'] .'</div>
					';
			}else{
				$loginModeStr .= '
					<div class="pointSpace">&ensp;</div>
					<div id="login_'. $item['type'] .'" class="pointItem" onclick="LoginModeTab(\''. $item['type'] .'\')">'. $item['name'] .'</div>
					';
			}
		}

		return '
		'. $logoStr . $announ .'
		<h2 class="text-center">
			'. $qrCodeStr . $loginModeStr .'
		</h2>
		<div class="dataform">
			<form id="loginForm" name="loginForm" method="post" action="users_deal.php?m=login" onsubmit="return CheckLoginForm();">
			<input type="hidden" id="backURL" name="backURL" value="'. urlencode($backURL) .'" />
			<input type="hidden" id="loginMode" name="loginMode" value="" />
			<input type="hidden" id="loginPwd" name="loginPwd" value="pwd" />
			<input type="hidden" id="loginMailMode" name="loginMailMode" value="'. $userSysArr['US_loginMailMode'] .'" />
			<input type="hidden" id="loginPhoneMode" name="loginPhoneMode" value="'. $userSysArr['US_loginPhoneMode'] .'" />
			<input type="hidden" id="pwdMode" name="pwdMode" value="" />
			<input type="hidden" id="pwdKey" name="pwdKey" value="" />
			<input type="hidden" id="pwdEnc" name="pwdEnc" value="" />

			<div class="input-warp gap" id="input_username">
				<span class="input-icon iconfont icon-yonghu1"></span>
				<input id="username" name="username" type="text" class="inputs" placeholder="请输入用户名" autocomplete="off">
			</div>
			<div class="input-warp gap" id="input_mail" style="display:none;">
				<span class="input-icon iconfont icon-email"></span>
				<input id="mail" name="mail" type="text" class="inputs" placeholder="请输入邮箱" onblur="CheckMail()" autocomplete="off">
				<span id="mailIsOk" class="isok"></span>
				<p id="mailStr" class="errMsg"></p>
			</div>
			<div class="form-item gap" id="input_mailCode" style="display:none;">
				<div class="input-warp s">
					<span class="input-icon iconfont icon-yanzhengma"></span>
					<input id="mailCode" name="mailCode" placeholder="请输入邮箱验证码" type="text" class="inputs"/>
				</div>
				<div class="pull-right">
					<input type="button" id="sendMail" class="btn lgbtn blue" onclick=\'SendMailCode(this.id,"mail","login","");\' value="发送验证码" />
				</div>
				'. ($userSysArr['US_loginMailMode']==2 ? '<div id="btn_mailPwd" class="inputBtn" onclick="LoginInputBtn(\'mailPwd\')">使用密码登录</div>' : '') .'
			</div>
			
			<div class="input-warp gap" id="input_phone" style="display:none;">
				<span class="input-icon iconfont icon-shouji"></span>
				<input id="phone" name="phone" type="text" class="inputs" placeholder="请输入手机" onblur="CheckPhone()">
				<span id="phoneIsOk" class="isok"></span>
				<p id="phoneStr" class="errMsg"></p>
			</div>
			<div class="form-item gap" id="input_phoneCode" style="display:none;">
				<div class="input-warp s">
					<span class="input-icon iconfont icon-yanzhengma"></span>
					<input id="phoneCode" name="phoneCode" placeholder="请输入短信验证码" type="text" class="inputs"/>
				</div>
				<div class="pull-right">
					<input type="button" id="sendPhone" class="btn lgbtn blue" onclick=\'SendPhoneCode(this.id,"phone","login","");\' value="发送验证码" />
				</div>
				'. ($userSysArr['US_loginPhoneMode']==2 ? '<div id="btn_phonePwd" class="inputBtn" onclick="LoginInputBtn(\'phonePwd\')">使用密码登录</div>' : '') .'
			</div>

			<div class="" id="input_pwd">
				<div class="input-warp gap">
					<span class="input-icon iconfont icon-baomi"></span>
					<input id="userpwd" name="userpwd" type="password" class="inputs" placeholder="请输入密码" autocomplete="off">
				</div>
				'. ($userSysArr['US_loginMailMode']==2 ? '<div id="btn_mailCode" class="inputBtn" style="display:none;" onclick="LoginInputBtn(\'mailCode\')">使用邮件验证码登录</div>' : '') .'
				'. ($userSysArr['US_loginPhoneMode']==2 ? '<div id="btn_phoneCode" class="inputBtn" style="display:none;" onclick="LoginInputBtn(\'phoneCode\')">使用短信验证码登录</div>' : '') .'
			</div>

			<div class="form-item gap" id="verCodeBox" style="display:'. $verCodeStyle .'">
				'. UcBase::VerCode('loginForm') .'
			</div>
			<div class="btn-warp gap">
				<div class="text-center">
					<button class="btn btn-block lgbtn blue">登录</button>
				</div>
			</div>
			<div class="gap">
				<div class="pull-right" style="margin-top: 6px">
					'. ($userSysArr['US_isMissPwd'] == 1 ? '<a href="?m=missPwd" class="link">忘记密码</a><span class="split-space">|</span>' : '') .'
					<a href="?m=reg&force=1" class="link">新用户注册</a>
				</div>
				<div class="pretty-box">'. $expTimeStr .'</div>
			</div>
			</form>
			<div class="biggap third-party-title">
				<h5 class="text-center"><span>第三方账号登录</span></h5>
			</div>
			<div class="third-auth">
				'. str_replace('[backURL]', urlencode($backURL), @$userApiArr['imgLoginWap'] .'') .'
			</div>
		</div>
		'. $announ2 . self::BottomInfo() .'
		<script language="javascript" type="text/javascript">
		LoginModeTab("'. $loginModeCurr .'");
		</script>
		';
	}



	// 忘记密码
	public static function MissPwdWeb(){
		global $userSysArr;

		$announ = $announ2 = '';
		if (strlen(trim(''. Str::RegExp($userSysArr['US_missPwdAnnoun'],'html'))) >= 3){
			$announ = '<div class="loginBox" style="width:100%;line-height:1.4;">'. $userSysArr['US_missPwdAnnoun'] .'</div>';
		}
		if (strlen(trim(''. Str::RegExp($userSysArr['US_missPwdAnnoun2'],'html'))) >= 3){
			$announ2 = '<div class="loginBox" style="width:100%;line-height:1.4;">'. $userSysArr['US_missPwdAnnoun2'] .'</div>';
		}

		if ($userSysArr['US_isMissPwd'] == 0){
			return '<div style="width:500px;text-align:center;margin:0 auto;padding:30px;font-size:16px;">忘记密码找回功能已关闭，如有问题联系管理员。</div>'. $announ;
		}

		$itemStr = '';
		$itemNum = 0;
		if ($userSysArr['US_isMissPwdUser'] == 1){
			$itemNum ++;
			$itemStr .= '<label><input type="radio" id="refType_username" name="refType" value="用户名" onclick="MissPwdType()" checked="checked" />用户名</label>&ensp;&ensp;';
		}
		if ($userSysArr['US_isMissPwdMail'] == 1 && AppMail::Jud()){
			$itemNum ++;
			$itemStr .= '<label><input type="radio" id="refType_mail" name="refType" value="邮箱" onclick="MissPwdType()" '. ($itemNum==1?'checked="checked"':'') .' />邮箱</label>&ensp;&ensp;';
		}
		if ($userSysArr['US_isMissPwdPhone'] == 1 && AppPhone::Jud()){
			$itemNum ++;
			$itemStr .= '<label><input type="radio" id="refType_phone" name="refType" value="手机" onclick="MissPwdType()" '. ($itemNum==1?'checked="checked"':'') .' />手机</label>&ensp;&ensp;';
		}
		return '
		'. $announ .'
		<div class="dataform">
			<h2 class="text-center">找回密码</h2>
			<form id="missForm" name="missForm" method="post" action="users_deal.php?m=missPwd" onsubmit="return CheckMissPwdForm();">
			<div id="refStr">
			<div class="input">
				查找方式：'. $itemStr .'
			</div>

			<div class="input-warp gap" id="usernameBox" style="display:none;">
				<span class="input-icon iconfont icon-yonghu1"></span>
				<input id="username" name="username" type="text" class="inputs" placeholder="请输入用户名" autocomplete="off">
			</div>

			<div class="input-warp gap" id="mailBox" style="display:none;">
				<span class="input-icon iconfont icon-yonghu1"></span>
				<input id="mail" name="mail" type="text" class="inputs" onblur="CheckMail()" placeholder="请输入邮箱" autocomplete="off">
				<span id="mailIsOk" class="isok"></span>
				<p id="mailStr" class="errMsg"></p>
			</div>

			<div class="input-warp gap" id="phoneBox" style="display:none;">
				<span class="input-icon iconfont icon-yonghu1"></span>
				<input id="phone" name="phone" type="text" class="inputs" onblur="CheckPhone()" placeholder="请输入手机号" autocomplete="off">
				<span id="phoneIsOk" class="isok"></span>
				<p id="phoneStr" class="errMsg"></p>
			</div>

			<div class="form-item gap">
				'. UcBase::VerCode('missPwd') .'
			</div>
			<div class="btn-warp gap">
				<div class="text-center">
					<button class="btn btn-block lgbtn blue" onclick="MissPwdSend()">查 询</button>
				</div>
			</div>

			</div>
			<div id="questionStr">
			</div>
			</form>
			<script language="javascript" type="text/javascript">MissPwdType();</script>
		</div>
		'. $announ2 . self::BottomInfo();
	}



	// 底部信息
	public static function BottomInfo(){
		global $tplSysArr;

		if (empty($tplSysArr)){ $tplSysArr = Cache::PhpFile('tplSys'); }
		
		$retStr = '';
		if ( strlen($tplSysArr['TS_beianName']) > 0 ){
			$retStr .= '<a href="'. (strlen($tplSysArr['TS_beianUrl']) > 0 ? 'https://beian.mps.gov.cn/#/query/webSearch?code='. $tplSysArr['TS_beianUrl'] : '') .'" target="_blank"><img src="'. UcBase::BeforeURL() .'inc_img/beian.png" style="margin-bottom:-5px;" />'. $tplSysArr['TS_beianName'] .'</a>';
		}
		if ( strlen($tplSysArr['TS_TCP']) > 0 ){
			if (strlen($retStr) > 0){
				$retStr .= '&ensp;&ensp;&ensp;';
			}
			$retStr .= '<a href="https://beian.miit.gov.cn/" target="_blank">'. $tplSysArr['TS_TCP'] .'</a>';
		}
		return '<div style="margin:35px 0 20px 0; width:100%; text-align:center;">'. $retStr .'</div>';
	}
}
?>